#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long  n,m,a;
	while(scanf("%lld %lld %lld",&n,&m,&a)!=EOF)
	{
		long long numl,numr;
		numl = (n/a);
		numr = (m/a);
		if(n%a) numl++;
		if(m%a) numr++;
		printf("%lld\n",numl*numr);
	}
}
